Skip to content

docs(quickstarts): fix silent failures on the react, react-spa, and pages-router pages - #399

Open
JoshKappler wants to merge 3 commits into
mainfrom
docs/quickstart-fixes-round-2
Open

docs(quickstarts): fix silent failures on the react, react-spa, and pages-router pages#399
JoshKappler wants to merge 3 commits into
mainfrom
docs/quickstart-fixes-round-2

Conversation

@JoshKappler

@JoshKappler JoshKappler commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to docs(quickstarts): fix first-run failures on the python, react, cli, and node pages #391: the remaining verified findings from the quickstart walkthroughs, each re-verified reproducing against main in a clean sandbox before fixing.
  • react: every path said src/ but create-react-router scaffolds app/, so a literal walk boots with GT silently absent, and two steps titled the same file so the second erased the first. Paths now match the scaffold, the root file compiles, the components get mounted in a route, and <html lang> follows the resolved locale.
  • react-spa: the Welcome component the guide builds was never imported, so the promised result never rendered. Added the App.tsx wiring and restored the scaffold's index.css import.
  • pages-router: steps 7 and 8 replaced pages/index.tsx without step 5's wrapped getServerSideProps, and contact.tsx contradicted the page's own FAQ, so strings silently stayed untranslated. Samples now show complete files, and a new FAQ entry wires <html lang> through _document.tsx.
  • All three pages now name a scaffold command (--no-app for the Pages Router) and state the Node floor the current scaffolds declare.

Testing

  • Every changed sample ran in a clean sandbox app (React Router 8.2, Vite 8, Next 16.2.11, gt-react/gt-next 11.0.12): tsc clean, builds pass, dev servers serve, keyless locale switching behaves as documented, <html lang> follows the cookie and Accept-Language, including garbage-cookie and 404 paths.
  • A worst-case pass applied every titled block verbatim in page order: all three apps still type-check, build, and serve, and a reader who stops at step 7 on the pages-router page still gets a working app.
  • Repo gates green locally: unsafe-HTML validation (425 files), link validation, full content build.

Notes

  • The old finding that the pages-router config snippet discards reactStrictMode no longer reproduces (the current scaffold ships an empty config), so it is left alone.
  • These steps use complete-file listings with keep/merge framing. docs(react): show quickstart file edits as before/after diffs #395 proposes diff-notation blocks for the same problem class; converting these three is a small follow-up if that lands as the house style.
  • Statically generated pages keep the fallback lang; the _document fix covers server-rendered pages, said in the FAQ entry.

The page's src/ paths do not exist in the app/ tree the scaffold creates,
so a literal walk boots with GT silently absent. Use app/ paths, name the
scaffold command, merge the two root.tsx steps into one compilable file,
mount the built components in a route, and make html lang follow the
resolved locale. Node floor comes from react-router's engines field.
The quickstart builds Welcome.tsx but nothing imports it, so the promised
result never renders. Add the App.tsx wiring, restore the index.css import
the main.tsx block dropped, name a scaffold command, and raise the stale
Node 18 prerequisite to the ranges Vite 8 supports.
…html lang

Steps 7 and 8 replace pages/index.tsx without the wrapped getServerSideProps
from step 5, and the contact.tsx sample contradicts the page FAQ, so strings
silently stay untranslated. Show complete files, add the missing wrapper,
restore the globals.css import in _app.tsx, name the --no-app scaffold flag,
and add a FAQ entry that wires html lang through _document.tsx.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant